//package com.gz.service.impl;
//
//import java.io.Serializable;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.security.access.PermissionEvaluator;
//import org.springframework.security.core.Authentication;
//import org.springframework.stereotype.Service;
//@Service
//public class UserPermissionServiceImpl implements PermissionEvaluator {
//
//    @Autowired
//    private PermissionEvaluator permissionService;
//
//    @Override
//    public boolean hasPermission(Authentication authentication, Object targetDomainObject, Object permission) {
//        String username = authentication.getName();
//        String domain = (String) targetDomainObject;
//        String perm = (String) permission;
//        return permissionService.hasPermission(authentication, domain, perm);
//    }
//
//    @Override
//    public boolean hasPermission(Authentication authentication, Serializable targetId, String targetType, Object permission) {
//        // 不支持基于ID的权限检查
//        return false;
//    }
//}